﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Data;

using PolePositionMobileUtilityGeneral;

namespace PolePositionMobileUtilityEntity
{
    public class EToptype : EBaseLookup
    {
        public EToptype()
            : base()
        {
            m_TableCollumnName = "name";
            m_TableCollumnId = "TopId";
            m_TableName = "tb_Tops";

        }

        public EToptype(int id, string name)
            : this()
        {
            Id = id;
            Name = name;
        }

        public EToptype[] GetAll()
        {
            DataTable _dt = SelectAll();
            EToptype[] arr = new EToptype[_dt.Rows.Count];
            for (int i = 0; i < _dt.Rows.Count; i++)
            {
                arr[i] = new EToptype(ConvertMobileHelper.ToInt32(_dt.Rows[i][m_TableCollumnId]), ConvertMobileHelper.Tostring(_dt.Rows[i][m_TableCollumnName]));
            }
            return arr;
        }
    }
}
